using UnityEngine;

namespace CinemaDirector
{
	[CutsceneItem("GameObject", "Match Position")]
	public class GGActionMatchPositionEvent : CinemaGlobalEvent
	{
		public new Transform transform;

		public Transform match;

		public bool matchx = true;

		public bool matchy = true;

		public bool matchz = true;

		protected Vector3 cachedPosition;

		public override void Initialize()
		{
			cachedPosition = transform.position;
		}

		public override void Stop()
		{
			if (!Application.isPlaying)
			{
				cachedPosition = transform.position;
			}
		}

		public override void Trigger()
		{
			Vector3 position = transform.position;
			Vector3 position2 = match.position;
			position.x = ((!matchx) ? position.x : position2.x);
			position.y = ((!matchy) ? position.y : position2.y);
			position.z = ((!matchz) ? position.z : position2.z);
			transform.position = position;
		}
	}
}
